#include "Account.h"

int Account::accountIDGenerator = 0;

Account::Account(int initizlizedBalance)
	: balance(initizlizedBalance), accountId(Account::accountIDGenerator++)
{

}

int Account::getAccountId() const
{
	return accountId;
}

double Account::getBalance()	const
{
	return balance;
}

void Account::setAccountOwner(Client& owner)
{
	this->owner = &owner;
}

void Account::setBalance(int newBalance)
{
	this->balance = newBalance;
}

ostream& operator<<(ostream& os, const Account& acc)
{
	acc.toOs(os);

	return os;
}

bool Account::operator==(const Account& other)	const
{
	if (balance == other.balance)
	{
		return true;
	}

	return false;
}

void Account::toOs(ostream& os)			const
{
	os << "Account={Id=" << accountId << ", Balance=" << balance << "}";
}

Account::~Account()
{

}
